package com.bee.user.common.vo;

import com.bee.user.common.domain.UserDO;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * @author Damin.yang
 * @date 2019/08/16 18:21
 */
@Data
public class UserVO {

    private Long id;

    private String username;

    private String name;

    private String phone;

    private String password;

    private String salt;

    private String sex;

    private String address;

    private String headImgUrl;

    /**
     * 0:禁用 1:启用
     */
    private Boolean enable;

    /**
     * 用户类型，0：普通用户，1：内部用户
     */
    private Integer type;

    private String token;

    public static UserVO convert(UserDO userDO) {
        if (userDO == null) {
            return null;
        }

        UserVO userVO = new UserVO();
        BeanUtils.copyProperties(userDO, userVO);
        return userVO;
    }
}
